<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>{{msg}}</h1>
        <!-- .self修饰符：事件只在本身触发的时候才触发 -->
        <!-- 只触发了childClick事件，因为parentClick加了.self修饰符，当触发parentClick时才触发 -->
        <div @click.self="parentClick">
            <div @click="childClick">
              <h1>点击子节点</h1>
            </div>
          </div>

    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        let vm=new Vue({
            el:"#app",
            data:{
                msg:"/(ㄒoㄒ)/~~",

            },
            methods:{
                parentClick:function(e){
                    console.log("点击了parentClick");
                },
                childClick:function(e){
                    console.log(e);
                    console.log("点击了childClick");
                }


            }




        })







    </script>

</body>
</html>